<?
include('../db/koneksi.php');
include('../db/manipulasi_table.php');
include '../lib/function.upload_file_int.php';
//==========================insert table================================

if($_FILES["foto"]["name"] !="" ){

			$lokasi = "../gambar/siswa/";
                        if(!is_dir($lokasi))
                        {
                            mkdir($lokasi);   
                        }
                        
			$nama_dest = $no_kunjungan."_".date("Ymd").substr($_FILES["foto"]["name"], -4);
			$photopegawai = upload_file_int("foto", $nama_dest, $lokasi);
			$InsertMstSiswa["foto"]=$lokasi."".$nama_dest;

		}
$InsertMstSiswa['kd_siswa']=$_POST['kd_siswa'];
$InsertMstSiswa['nm_siswa']=$_POST['nm_siswa'];
$InsertMstSiswa['alamat']=$_POST['alamat'];
$InsertMstSiswa['tmpt_lahir']=$_POST['tmpt_lahir'];
$InsertMstSiswa['tgl_lahir']=$_POST['tgl_lahir'];
$InsertMstSiswa['tgl_daftar']=$_POST['tgl_daftar'];
$InsertMstSiswa['tgl_selesai']=$_POST['tgl_selesai'];
$InsertMstSiswa['email']=$_POST['email'];
$InsertMstSiswa['noHp']=$_POST['nohp'];
$InsertMstSiswa['jenkel']=$_POST['jenkel'];
$InsertMstSiswa['agama']=$_POST['agama'];
insert_table('mst_siswa',$InsertMstSiswa);

echo "<script> window.opener.location.reload(); window.close();</script>";
//============================= END ============================
?> 
